<template>
  <footer class="footer">
    <div class="container">
      <div class="footer-content">
        <!-- About Section -->
        <div class="footer-section">
          <h3>Lucy African Fashion</h3>
          <p>{{ appStore.storeInfo.site_description || 'Your trusted African Wear Supplier from China' }}</p>
          <div class="social-links">
            <a v-if="appStore.storeInfo.whatsapp" 
               :href="`https://wa.me/${appStore.storeInfo.whatsapp?.replace(/\s/g, '')}`" 
               target="_blank" 
               class="social-link">
              <n-icon size="24"><LogoWhatsapp /></n-icon>
            </a>
            <a v-if="appStore.storeInfo.instagram" 
               :href="`https://instagram.com/${appStore.storeInfo.instagram?.replace('@', '')}`" 
               target="_blank" 
               class="social-link">
              <n-icon size="24"><LogoInstagram /></n-icon>
            </a>
            <a v-if="appStore.storeInfo.email" 
               :href="`mailto:${appStore.storeInfo.email}`" 
               class="social-link">
              <n-icon size="24"><MailOutline /></n-icon>
            </a>
          </div>
        </div>

        <!-- Quick Links -->
        <div class="footer-section">
          <h4>Quick Links</h4>
          <ul class="footer-links">
            <li><router-link to="/">Home</router-link></li>
            <li><router-link to="/products">Products</router-link></li>
            <li><router-link to="/about">About Us</router-link></li>
            <li><router-link to="/contact">Contact</router-link></li>
          </ul>
        </div>

        <!-- Contact Info -->
        <div class="footer-section">
          <h4>Contact Us</h4>
          <ul class="contact-info">
            <li v-if="appStore.storeInfo.address">
              <n-icon><LocationOutline /></n-icon>
              <span>{{ appStore.storeInfo.address }}</span>
            </li>
            <li v-if="appStore.storeInfo.phone">
              <n-icon><CallOutline /></n-icon>
              <span>{{ appStore.storeInfo.phone }}</span>
            </li>
            <li v-if="appStore.storeInfo.email">
              <n-icon><MailOutline /></n-icon>
              <span>{{ appStore.storeInfo.email }}</span>
            </li>
          </ul>
        </div>

        <!-- Business Hours -->
        <div class="footer-section">
          <h4>Business Hours</h4>
          <ul class="business-hours">
            <li>Monday - Friday: 9:00 AM - 6:00 PM</li>
            <li>Saturday: 9:00 AM - 5:00 PM</li>
            <li>Sunday: Closed</li>
          </ul>
        </div>
      </div>

      <!-- Copyright -->
      <div class="footer-bottom">
        <p>&copy; {{ new Date().getFullYear() }} Lucy African Fashion. All rights reserved.</p>
      </div>
    </div>
  </footer>
</template>

<script setup>
import { NIcon } from 'naive-ui'
import { 
  LogoWhatsapp, 
  LogoInstagram, 
  MailOutline, 
  LocationOutline, 
  CallOutline 
} from '@vicons/ionicons5'
import { useAppStore } from '@/stores/app'

const appStore = useAppStore()
</script>

<style lang="scss" scoped>
.footer {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: var(--color-white);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section {
  h3, h4 {
    color: var(--color-primary-light);
    margin-bottom: 1rem;
    font-size: 1.125rem;
  }
  
  p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
  }
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  
  .social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    transition: var(--transition-fast);
    
    &:hover {
      background-color: var(--color-primary);
      transform: translateY(-3px);
    }
  }
}

.footer-links,
.contact-info,
.business-hours {
  list-style: none;
  padding: 0;
  
  li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    
    a {
      color: rgba(255, 255, 255, 0.9);
      text-decoration: none;
      transition: var(--transition-fast);
      
      &:hover {
        color: var(--color-primary-light);
        padding-left: 0.5rem;
      }
    }
  }
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  
  p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
  }
}

@media (max-width: 768px) {
  .footer {
    padding: 2rem 0 1rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
</style>

